{% extends "common/layout_main.html" %}


{% block content %}
    <script src="http://cdn.highcharts.com.cn/highcharts/highcharts.js"></script>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
     <script src="{{ buildStaticUrl('/js/common.js') }}"></script>
<div class="wrapper wrapper-content">
            <div class="row">
                <div class="col-lg-3">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <span class="label label-primary pull-right">日统计</span>
                            <h5>营收概况</h5>
                        </div>
                        <div class="ibox-content">
                            <h1 class="no-margins">{{ data.finance.today }}</h1>
                            <small>近30日：{{ data.finance.month }}</small>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <span class="label label-primary pull-right">日统计</span>
                            <h5>订单</h5>
                        </div>
                        <div class="ibox-content">
                            <h1 class="no-margins">{{ data.order.today }}</h1>
                            <small>近30日：{{ data.order.today }}</small>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <span class="label label-primary pull-right">日统计</span>
                            <h5>会员</h5>
                        </div>
                        <div class="ibox-content">
                            <h1 class="no-margins">{{ data.member.total }}</h1>
                            <small>今日新增：{{ data.member.today_new }}</small>
                            <small>近30日新增：{{ data.member.month_new }}</small>
                        </div>
                    </div>
                </div>
                <div class="col-lg-3">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <span class="label label-primary pull-right">日统计</span>
                            <h5>分享</h5>
                        </div>
                        <div class="ibox-content">
                            <h1 class="no-margins">{{ data.shared.today }}</h1>
                            <small>近30日：{{ data.shared.month }}</small>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12" id="container" style="height:400px;border: 1px solid #e6e6e6;padding-top: 20px;">
                    使用highchart画图
                    <script>

                        var data = 1
                        var series = 1
                        console.log('this',this);
                        var that = this
                            $.ajax({
                            url:common_ops.buildUrl("/chart/dashboard"),
                            dataType:'json',
                            success:function (res){
                                console.log(res,'this',this,'data',data);
                                data = res.data.categories;
                                series = res.data['series'];
                                {#return data#}
                             var chart = Highcharts.chart('container', {
                                chart: {
                                    type: 'spline'
                                },
                                title: {
                                    text: '会员总数和订单总数统计'
                                },

                            xAxis: {
                                    categories:data
                            },
                                series:series
                            });

                            }
                        });
                        console.log('that',series,'that',data)
                    </script>

                </div>
                <div class="col-lg-12" id="finance" style="height: 400px;border: 1px solid #e6e6e6;padding-top: 20px;">
                    使用highchart画图
                                <script>
                               var data = 1
                        var series = 1
                        console.log('this',this);
                        var that = this
                            $.ajax({
                            url:common_ops.buildUrl("/chart/finance"),
                            dataType:'json',
                            success:function (res){
                                console.log(res,'this',this,'data',data);
                                data = res.data.categories;
                                series = res.data['series'];
                                {#return data#}
                             var chart = Highcharts.chart('finance', {
                                chart: {
                                    type: 'spline'
                                },
                                title: {
                                    text: '日营收报表统计'
                                },

                            xAxis: {
                                    categories:data
                            },
                                series:series
                            });

                            }
                        });

                    </script>

                </div>
            </div>
        </div>

{% endblock %}
{% block js %}
    <script src="{{ buildStaticUrl('/js/common.js') }}"></script>
<script src="{{ buildStaticUrl('/plugins/highcharts/highcharts.js') }}"></script>
{#<script src="{{ buildStaticUrl('/js/chart.js') }}"></script>#}

<script src="{{ buildStaticUrl('/js/index/index.js') }}"></script>


{% endblock %}